#!/usr/bin/env python

from subprocess import call

import serial
import time 

def Display( file ):
	f = open( file, "r" )
	d = f.read();
	f.close;

	ser.write( "%c" % 0 )
	for i in range(128*8):
		ser.write( "%c" % d[i] )


def send( s ):
	for i in s:
		ser.write(i)
		#time.sleep(.005)



ser = serial.Serial("/dev/ttyUSB0", 9600)
i = 0
ser.write( "`                                                                                                                           " )
ser.write( "                                                                                                                           " )

#Display( "konami_font.bin")


while 1:
	
	s = ""
	#s = time.strftime("~ %a, %d %b %Y %H:%M:%S +0000", time.gmtime())
	s = time.strftime("`%H:%M:%S\r", time.gmtime())
	s = s + "\r"
	s = s + time.strftime("%a, %d %b %Y\r", time.gmtime())

	
	ser.write( s.upper() )
	#print s
	time.sleep(1)

